import string
import secrets

def generate_password():
    all_characters = string.ascii_letters + string.digits + string.punctuation
    password = ''.join(secrets.choice(all_characters) for _ in range(16))
    return password